<script>
    let time1 = +new Date("2021-04-1 00:00:00")
    let time2 = +new Date("2021-04-3 04:27:00")
    console.log(time1);
    console.log(time2);

    let str = "上海自来水来自海上"
    function isBack(str) {
        var flag = true;
        for (var i = 0; i < str.length / 2; i++) {
            console.log(str[i] + "====" + str[str.length - i - 1]);
            if (str[i].charCodeAt() !== str[str.length - i - 1].charCodeAt()) {
                console.log(str[i] + "====" + str[str.length - i - 1]);
                flag = false
                break
            }
            
        }
        return flag
    }
    console.log(isBack(str));

</script>